//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.itheima.pinda.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.authority.enumeration.auth.AuthorizeType;
import com.itheima.pinda.authority.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import javax.validation.constraints.NotNull;

@TableName("pd_auth_role_authority")
@ApiModel(
        value = "RoleAuthority",
        description = "角色的资源"
)
public class RoleAuthority extends SuperEntity<Long> {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("资源id")
    @NotNull(
            message = "资源id不能为空"
    )
    @TableField("authority_id")
    private Long authorityId;
    @ApiModelProperty("权限类型")
    @NotNull(
            message = "权限类型不能为空"
    )
    @TableField("authority_type")
    private AuthorizeType authorityType;
    @ApiModelProperty("角色id")
    @NotNull(
            message = "角色id不能为空"
    )
    @TableField("role_id")
    private Long roleId;

    public RoleAuthority(Long id, LocalDateTime createTime, Long createUser, Long authorityId, AuthorizeType authorityType, Long roleId) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.authorityId = authorityId;
        this.authorityType = authorityType;
        this.roleId = roleId;
    }

    public static RoleAuthority.RoleAuthorityBuilder builder() {
        return new RoleAuthority.RoleAuthorityBuilder();
    }

    public Long getAuthorityId() {
        return this.authorityId;
    }

    public AuthorizeType getAuthorityType() {
        return this.authorityType;
    }

    public Long getRoleId() {
        return this.roleId;
    }

    public RoleAuthority setAuthorityId(final Long authorityId) {
        this.authorityId = authorityId;
        return this;
    }

    public RoleAuthority setAuthorityType(final AuthorizeType authorityType) {
        this.authorityType = authorityType;
        return this;
    }

    public RoleAuthority setRoleId(final Long roleId) {
        this.roleId = roleId;
        return this;
    }

    public RoleAuthority() {
    }

    public RoleAuthority(final Long authorityId, final AuthorizeType authorityType, final Long roleId) {
        this.authorityId = authorityId;
        this.authorityType = authorityType;
        this.roleId = roleId;
    }

    public String toString() {
        return "RoleAuthority(super=" + super.toString() + ", authorityId=" + this.getAuthorityId() + ", authorityType=" + this.getAuthorityType() + ", roleId=" + this.getRoleId() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof RoleAuthority)) {
            return false;
        } else {
            RoleAuthority other = (RoleAuthority)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label49: {
                    Object this$authorityId = this.getAuthorityId();
                    Object other$authorityId = other.getAuthorityId();
                    if (this$authorityId == null) {
                        if (other$authorityId == null) {
                            break label49;
                        }
                    } else if (this$authorityId.equals(other$authorityId)) {
                        break label49;
                    }

                    return false;
                }

                Object this$authorityType = this.getAuthorityType();
                Object other$authorityType = other.getAuthorityType();
                if (this$authorityType == null) {
                    if (other$authorityType != null) {
                        return false;
                    }
                } else if (!this$authorityType.equals(other$authorityType)) {
                    return false;
                }

                Object this$roleId = this.getRoleId();
                Object other$roleId = other.getRoleId();
                if (this$roleId == null) {
                    if (other$roleId != null) {
                        return false;
                    }
                } else if (!this$roleId.equals(other$roleId)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof RoleAuthority;
    }

    public int hashCode() {
        Boolean PRIME = true;
        int result = super.hashCode();
        Object $authorityId = this.getAuthorityId();
        result = result * 59 + ($authorityId == null ? 43 : $authorityId.hashCode());
        Object $authorityType = this.getAuthorityType();
        result = result * 59 + ($authorityType == null ? 43 : $authorityType.hashCode());
        Object $roleId = this.getRoleId();
        result = result * 59 + ($roleId == null ? 43 : $roleId.hashCode());
        return result;
    }

    public static class RoleAuthorityBuilder {
        private Long id;
        private LocalDateTime createTime;
        private Long createUser;
        private Long authorityId;
        private AuthorizeType authorityType;
        private Long roleId;

        RoleAuthorityBuilder() {
        }

        public RoleAuthority.RoleAuthorityBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public RoleAuthority.RoleAuthorityBuilder createTime(final LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public RoleAuthority.RoleAuthorityBuilder createUser(final Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public RoleAuthority.RoleAuthorityBuilder authorityId(final Long authorityId) {
            this.authorityId = authorityId;
            return this;
        }

        public RoleAuthority.RoleAuthorityBuilder authorityType(final AuthorizeType authorityType) {
            this.authorityType = authorityType;
            return this;
        }

        public RoleAuthority.RoleAuthorityBuilder roleId(final Long roleId) {
            this.roleId = roleId;
            return this;
        }

        public RoleAuthority build() {
            return new RoleAuthority(this.id, this.createTime, this.createUser, this.authorityId, this.authorityType, this.roleId);
        }

        public String toString() {
            return "RoleAuthority.RoleAuthorityBuilder(id=" + this.id + ", createTime=" + this.createTime + ", createUser=" + this.createUser + ", authorityId=" + this.authorityId + ", authorityType=" + this.authorityType + ", roleId=" + this.roleId + ")";
        }
    }
}
